using FluentValidation;

namespace Sckf.MicroService.Services.Catalog.Application.Catalogs.Commands;


public class CreateCatalogCommandValidator : AbstractValidator<CreateCatalogCommand>
{
    public CreateCatalogCommandValidator()
    {
        RuleFor(cmd => cmd.Name).Null().WithMessage("分类目录名称不能为空");
        RuleFor(cmd => cmd.Name).MaximumLength(50).WithMessage("分类目录名称不能超过50个字符");
        RuleFor(cmd=>cmd.Description).MaximumLength(200).WithMessage("分类目录描述不能超过200个字符");
    }
}